<template>
  <div class="404">你请求的页面不存在,{{ count }}后跳转</div>
</template>
<script setup>
import { onMounted, ref } from "vue";
import { useRouter } from "vue-router";
let count = ref(10),
  id = 0,
  router = useRouter();
onMounted(() => {
  if (id) {
    clearInterval(id);
  }
  id = setInterval(() => {
    count.value--;
    if (count.value === 0) {
      router.push("/home");
      count.value = 10;
      clearInterval(id);
    }
  }, 1000);
});
</script>